#include "xregister_server.h"
#include "xregister_handle.h"
#include "thread_pool/XThreadPool.h"
#include <XMsg.h>
XServiceHandle *XRegisterServer::CreateServiceHandle()
{
    XRegisterHandle *handle = new XRegisterHandle;
    // 设置读超时，用于接收心跳包
    handle->set_read_timeout_ms_(5000);
    return handle;
}

void XRegisterServer::Main(int argc, char **argv)
{
    XRegisterHandle::RegMsgCallback();
    int port = REGISTER_PORT;//
    if (argc > 1)
    {
        port = atoi(argv[1]);
    }
    set_server_port_(port);
}

void XRegisterServer::Wait()
{
    XThreadPool::Wait();
}
